Skip to content

feat: Run blocking plans via websockets#1413

Draft
tpoliaw wants to merge 27 commits into
mainfrom
ws
Draft

feat: Run blocking plans via websockets#1413
tpoliaw wants to merge 27 commits into
mainfrom
ws

Conversation

@tpoliaw

@tpoliaw tpoliaw commented Feb 25, 2026

Copy link
Copy Markdown
Contributor

As an intermediate step before (or instead of?) redesigning the server sub-process handling, we can add a websocket endpoint to run the same submit-listen-start approach that the client runs remotely.

@tpoliaw

tpoliaw commented Feb 25, 2026

Copy link
Copy Markdown
Contributor Author

Rough next steps in no particular order

  • Move websocket client method into BlueapiRestClient
  • Add wrapper method in BlueapiClient?
  • Add unstable/preview --ws flag to cli run method
  • Deal with auth. Browser websocket api can't set headers
  • Users + user-agents
  • Include data/progress events
  • Add service/meta events for error handling etc
  • Handle client aborting
  • Check interaction with server being busy
  • Wrap pipe/unpipe into something that doesn't need finally handling
  • See what happens when listeners fall over/slow down - do messages back up
  • Add middleware for debug logging

@abbiemery

Copy link
Copy Markdown
Contributor
  • store api url withouth scheme, and add scheme to http and ws calls respectively. (request_and_deserialise)

Comment thread src/blueapi/service/interface.py Outdated
Comment thread src/blueapi/service/interface.py Outdated
Comment thread src/blueapi/service/runner.py
@tpoliaw tpoliaw force-pushed the ws branch 2 times, most recently from 910d91b to b5c01e6 Compare March 12, 2026 16:41
@tpoliaw tpoliaw force-pushed the ws branch 2 times, most recently from 71bdbcf to 2371239 Compare April 14, 2026 15:28
Comment thread src/blueapi/service/interface.py Fixed
Comment thread src/blueapi/service/middleware.py Fixed
Comment thread src/blueapi/service/middleware.py Fixed
Comment thread src/blueapi/service/interface.py Dismissed
Should still investigate if this is still useful but not in this change
@codecov

codecov Bot commented Jun 29, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 38.12500% with 99 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.21%. Comparing base (f6eebe6) to head (30d54e6).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/blueapi/service/main.py 20.45% 35 Missing ⚠️
src/blueapi/service/runner.py 42.85% 24 Missing ⚠️
src/blueapi/service/interface.py 46.42% 15 Missing ⚠️
src/blueapi/client/client.py 13.33% 13 Missing ⚠️
src/blueapi/client/rest.py 42.10% 11 Missing ⚠️
src/blueapi/cli/cli.py 80.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1413      +/-   ##
==========================================
- Coverage   95.93%   93.21%   -2.73%     
==========================================
  Files          44       44              
  Lines        3269     3417     +148     
==========================================
+ Hits         3136     3185      +49     
- Misses        133      232      +99     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants